//控制流分析
function example() {
  let y: string | number | boolean;
  y = Math.random() < 0.5

  //let y: boolean
  console.log(y);

  if (Math.random() < 0.5) {
    y = 'hello'
    // y: string
    console.log(y);
  } else {
    y = 100
    // y: number
    console.log(y);
  }
  return y
}


let y = example();
y = 'hello'
y = 100
y = true
